<?php

namespace FortendBundle\Controller;

use BaseBundle\Controller\BaseController;
use Symfony\Component\HttpFoundation\Request;

class UserController extends BaseController
{
    // 个人主页
    public function userIndexAction(Request $request)
    {
        $token = $request->getSession()->get('token');
        $user_info = $token != null ? $this->getUserInfo($token) : array();

        $data = array(
            'user_info' => $user_info,
        );

        return $this->render('@Fortend/user/userIndex.html.twig', array('data'=>$data));
    }

    // 个人设置
    public function userSetAction(Request $request)
    {
        $token = $request->getSession()->get('token');
        $user_info = $token != null ? $this->getUserInfo($token) : array();

        $data = array(
            'user_info' => $user_info,
        );

        return $this->render('@Fortend/user/userSet.html.twig', array('data'=>$data));
    }
}